
#pragma once

#include "../Main.h"

#define VIS_MAIN_NUM_RT 8

//#include <SDL_video.h>

class Preset;
class SDLEventHandler;
class RenderTarget;

class Visuals_Main
{
	public:

		static void	Initialise( Preset* pxPreset );
		static void Update();
		static void Render();
		static void Shutdown();

		static u_int GetWindowID();

		static bool HandleEvent( const SDL_Event& xEvent );

		static u_int GetWindowHeight();
		static u_int GetWindowWidth();

		inline static bool IsRenderingPreset() { return s_bRenderingPreset; }
		
		static void BindRTAsTexture();
		static void ResolveRT( bool bCopy = true );
		static void ResolvePreviousRT();

		static void PushRenderTarget();
		static void PopRenderTarget();

	private:

		inline static const RenderTarget* GetCurrentRenderTarget() { return s_pxRTStack[ s_iCurrentTarget ]; }

		static SDL_Window* s_pxWindow;
		static SDL_GLContext s_xContext;
		static Preset* s_pxPreset;
		static RenderTarget* s_pxScratchRT;
		static RenderTarget* s_pxRTStack[ VIS_MAIN_NUM_RT ];
		static int s_iCurrentTarget;
		static bool s_bRenderingPreset;

};

//eof
